{
  "properties" : { },
  "id" : "b1ef0827e34a4eea95ff6ee9c87ed4e5",
  "script" : null,
  "groupId" : "0a27aa68845d4697af036b966fa6dea4",
  "name" : "查询日志",
  "createTime" : 1714063371701,
  "updateTime" : 1712237730665,
  "lock" : null,
  "createBy" : "管理员",
  "updateBy" : "管理员",
  "path" : "list",
  "method" : "GET",
  "parameters" : [ {
    "name" : "userName",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "apiName",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "current",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "Integer",
    "type" : null,
    "defaultValue" : "1",
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "limit",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "Integer",
    "type" : null,
    "defaultValue" : "10",
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "orderProperty",
    "value" : "create_date",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "orderSort",
    "value" : "1",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "startTime",
    "value" : "2024-04-04 15:00:59",
    "description" : null,
    "required" : false,
    "dataType" : "Date",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "endTime",
    "value" : "2024-04-04 21:59:59",
    "description" : null,
    "required" : false,
    "dataType" : "Date",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import com.gitee.fastmybatis.core.query.Sort
import com.alibaba.fastjson.JSON;
import com.gitee.fastmybatis.core.query.Query;
import 'com.wiwf.model.mapper.admin.dao.SysApiLogMapper' as logMapper;

var query = new Query().page(current, limit);

if(userName){
    query.likeRight('`user_name`', userName);
}
if(apiName){
    query.likeRight('`api_name`', apiName);
}
if(startTime){
    query.gt('`create_date`', startTime);
    query.lt('`create_date`', endTime);
}

if(orderProperty){
    query.orderby(orderProperty, orderSort? Sort.ASC: Sort.DESC);
} else {
    query.orderby('`create_date`', Sort.DESC);
}

var selectData = logMapper.page(query);

return selectData